<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <!-- <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"> -->
    <script type="text/javascript" src="./stitic/js/jquery-3.4.1.min.js" ></script>
    <title>个人信息</title>
  </head>
  <body onload="init()">
    <div class="container a4-endwise" title="test02" style="padding: 25.4mm 94px 25.4mm 94px;">
    	 <table border=1; cellpadding=12; cellspacing=0; align=center width="90%" id="formDialog">
        <tr><td align="center" colspan="10">个人基本信息</td></tr>
        <tr>
            <td>姓名</td>
            <td><input type="text" name="name" field="name" disabled> </td>
            <td>性别</td>
            <td width="15%"><input type="text" name="sex" field="sex" disabled></td>
            <td >出生日期</td>
            <td width="15%"><input type="text" field="birth" disabled></td>
            <td>民族</td>
            <td><input type="text" field="nation" disabled></td>
            <td >政治面貌</td>
            <td><input type="text" field="politics" disabled></td>
        </tr>
        <tr>
            <td >身份证号</td>
            <td colspan="2"><input type="text" field="idnumber" disabled></td>
            <td>工作单位</td>
            <td colspan="2"><input type="text" field="sch" disabled></td>
            <td >行政职务</td>
            <td ><input type="text" field="preoccupation" disabled></td>
            <td >专业技术职务</td>
            <td><input type="text" field="majoroccupation" disabled></td>
        </tr>
        <tr>
            <td>参加工作时间</td>
            <td><input type="text" field="majortime" disabled></td>
            <td >职务级别</td>
            <td colspan="2"><input type="text" field="jobrank" disabled></td>
            <td>最高学历</td>
            <td colspan="2"><input type="text" field="edu" disabled></td>
            <td >最后学位</td>
            <td><input type="text" field="degree" disabled></td>
        </tr>
        <tr>
            <td >邮政编码</td>
            <td><input type="text" field="postalcode" disabled></td>
            <td >办公电话</td>
            <td><input type="text" field="office" disabled></td>
            <td >手机</td>
            <td><input type="text" field="phone" disabled></td>
            <td>qq号</td>
            <td colspan="1.5"><input type="text" field="qq" disabled></td>
            <td  colspan="1.5">电子信箱</td>
            <td><input type="text" field="email" disabled></td>
        </tr>
        <tr>
            <td>传真</td>
            <td><input type="text" field="fax" disabled></td>
            <td>通讯地址</td>
            <td colspan="7"><input type="text" field="address" disabled></td>
        </tr>
    </table>
    <table border=1; cellpadding=12; cellspacing=0; align=center  width="90%" id='exwork_table'>
        <tr><td align="center" colspan="10">工作经历</td></tr>
        <tr>
            <th>工作单位</th>
            <th>职务</th>
            <th>开始时间</th>
            <th>结束时间</th>
        </tr>
    </table>
    <table class="table table-bordered" id='exedu_table' border=1; cellpadding=12; cellspacing=0; align=center  width="90%">
        <tr><td align="center" colspan="10">教育经历</td></tr>
        <tr>
            <th>学历类型</th>
            <th>毕业院校</th>
            <th>专业</th>
            <th>毕业时间</th>
            <th>学制</th>
            <th>学位</th>
            <th>学位授予时间</th>
            <th>授予学校</th>
            <th>授予学校办学层次</th>
            <th>授予学校性质</th>
        </tr>
    </table>
    <table border=1; cellpadding=12; cellspacing=0; align=center  width="90%" id='extrain_table' >
        <tr><td align="center" colspan="10">培训经历</td></tr>
        <tr>
            <td >培训名称</td>
            <td >组织单位</td>
            <td >培训地点</td>
            <td >开始时间</td>
            <td >结束时间</td>
            <td >培训级别</td>
            <td >培训期数</td>
        </tr>
    </table>
    <table border=1; cellpadding=12; cellspacing=0; align=center  width="90%" id='exproject_table'>
        <tr><td align="center" colspan="10">科研项目</td></tr>
        <tr>
            <td >项目编号</td>
            <td >项目名称</td>
            <td >项目类型</td>
        </tr>
    </table>
    <table border=1; cellpadding=12; cellspacing=0; align=center  width="90%" id='exachievement_table'>
        <tr><td align="center" colspan="10">科研成果</td></tr>
        <tr>
            <td >成果名称</td>
            <td >出版单位</td>
            <td >出版时间</td>
        </tr>
    </table>
    <table border=1; cellpadding=12; cellspacing=0; align=center  width="90%" id='exhonor_table'>
        <tr><td align="center" colspan="10">荣誉奖项</td></tr>
        <tr>
                <td>获奖名称</td>
                <td>获奖时间</td>
                <td>授予单位</td>
        </tr>
    </table>
    </div>
    <!-- <table border=1; cellpadding=12; cellspacing=0; align=center width="90%" id="formDialog">
        <tr><td align="center" colspan="10">个人基本信息</td></tr>
        <tr>
            <td>姓名</td>
            <td><input type="text" name="name" field="name" disabled> </td>
            <td>性别</td>
            <td width="15%"><input type="text" name="sex" field="sex" disabled></td>
            <td >出生日期</td>
            <td width="15%"><input type="text" field="birth" disabled></td>
            <td>民族</td>
            <td><input type="text" field="nation" disabled></td>
            <td >政治面貌</td>
            <td><input type="text" field="politics" disabled></td>
        </tr>
        <tr>
            <td >身份证号</td>
            <td colspan="2"><input type="text" field="idnumber" disabled></td>
            <td>工作单位</td>
            <td colspan="2"><input type="text" field="sch" disabled></td>
            <td >行政职务</td>
            <td ><input type="text" field="preoccupation" disabled></td>
            <td >专业技术职务</td>
            <td><input type="text" field="majoroccupation" disabled></td>
        </tr>
        <tr>
            <td>参加工作时间</td>
            <td><input type="text" field="majortime" disabled></td>
            <td >职务级别</td>
            <td colspan="2"><input type="text" field="jobrank" disabled></td>
            <td>最高学历</td>
            <td colspan="2"><input type="text" field="edu" disabled></td>
            <td >最后学位</td>
            <td><input type="text" field="degree" disabled></td>
        </tr>
        <tr>
            <td >邮政编码</td>
            <td><input type="text" field="postalcode" disabled></td>
            <td >办公电话</td>
            <td><input type="text" field="office" disabled></td>
            <td >手机</td>
            <td><input type="text" field="phone" disabled></td>
            <td>qq号</td>
            <td colspan="1.5"><input type="text" field="qq" disabled></td>
            <td  colspan="1.5">电子信箱</td>
            <td><input type="text" field="email" disabled></td>
        </tr>
        <tr>
            <td>传真</td>
            <td><input type="text" field="fax" disabled></td>
            <td>通讯地址</td>
            <td colspan="7"><input type="text" field="address" disabled></td>
        </tr>
    </table>
    <table border=1; cellpadding=12; cellspacing=0; align=center  width="90%" id='exwork_table'>
        <tr><td align="center" colspan="10">工作经历</td></tr>
        <tr>
            <th>工作单位</th>
            <th>职务</th>
            <th>开始时间</th>
            <th>结束时间</th>
        </tr>
    </table>
    <table class="table table-bordered" id='exedu_table' border=1; cellpadding=12; cellspacing=0; align=center  width="90%">
        <tr><td align="center" colspan="10">教育经历</td></tr>
        <tr>
            <th>学历类型</th>
            <th>毕业院校</th>
            <th>专业</th>
            <th>毕业时间</th>
            <th>学制</th>
            <th>学位</th>
            <th>学位授予时间</th>
            <th>授予学校</th>
            <th>授予学校办学层次</th>
            <th>授予学校性质</th>
        </tr>
    </table>
    <table border=1; cellpadding=12; cellspacing=0; align=center  width="90%" id='extrain_table' >
        <tr><td align="center" colspan="10">培训经历</td></tr>
        <tr>
            <td >培训名称</td>
            <td >组织单位</td>
            <td >培训地点</td>
            <td >开始时间</td>
            <td >结束时间</td>
            <td >培训级别</td>
            <td >培训期数</td>
        </tr>
    </table>
    <table border=1; cellpadding=12; cellspacing=0; align=center  width="90%" id='exproject_table'>
        <tr><td align="center" colspan="10">科研项目</td></tr>
        <tr>
            <td >项目编号</td>
            <td >项目名称</td>
            <td >项目类型</td>
        </tr>
    </table>
    <table border=1; cellpadding=12; cellspacing=0; align=center  width="90%" id='exachievement_table'>
        <tr><td align="center" colspan="10">科研成果</td></tr>
        <tr>
            <td >成果名称</td>
            <td >出版单位</td>
            <td >出版时间</td>
        </tr>
    </table>
    <table border=1; cellpadding=12; cellspacing=0; align=center  width="90%" id='exhonor_table'>
        <tr><td align="center" colspan="10">荣誉奖项</td></tr>
        <tr>
                <td>获奖名称</td>
                <td>获奖时间</td>
                <td>授予单位</td>
        </tr>
    </table>-->

  </body>
  <!-- <script type="text/javascript" src="./stitic/js/jquery-3.4.1.min.js" ></script> -->
  <script type="text/javascript">
    var form ={
        name:'',
        sex:'',
        nation:'',
        birth:'',
        edu: '',
        degree: '',
        politics:'',
        preoccupation: '',
        majoroccupation: '',
        majortime:'',
        sch:'',
        jobrank: '',
        idnumber: '',
        address: '',
        postalcode: '',
        office: '',
        phone: '',
        qq: '',
        email: '',
        fax: ''
    }  
    function getQueryString(name) {
        var result=window.location.search.match(new RegExp("[\?\&]" + name + "=([^\&]+)", "i"));
        if(result==null || result.length<0)
        {
            return "";
        }
        return result[1];
    } 
    function init(){
        var id = getQueryString('item');
        // console.log(id);
        $.ajax({
            type: "POST",
            url: "../../index.php/admin/Train/TrainList", //这里写接口地址，
            data: {
                id:id
            }, //调用时的参数
            dataType: "json",//返回json,text,html你自己定
            success: function(data){//成功
                // console.log(data.data.train[0])   
                for(var p in data.data){
                   if(p == "train"){
                       //基本信息渲染到表格
                        var field = $("#formDialog [field]");
                        field.each(function () {
                            var value = data.data.train[0][$(this).attr("field")];
                            $(this).val(value);
                        }); 
                      $("input[field='sex']").val(data.data.train[0].sex == 1?'男':'女');
                     dealSch(data.data.train[0].sch)
                   }else if(p == "exwork"){
                    //console.log(data.data.exwork)
                    //将工作经历渲染到表格
                  /*   if(data.data.exwork.length == 0){
                     	tr = '<td>' + '无工作经历' +  '</td>'
                       	td.colSpan = 4;
                        $("#exwork_table").append('<tr>'+tr+'</tr>')
                     }
                     */
                        for(var i in data.data.exwork){
                            var tr;
                            tr = '<td>' + data.data.exwork[i].work + '</td>' + 
                            '<td>' + data.data.exwork[i].preoccupation + '</td>'  + 
                            '<td>' + data.data.exwork[i].start_time + '</td>' + 
                            '<td>' + data.data.exwork[i].end_time + '</td>'
                            $("#exwork_table").append('<tr>'+tr+'</tr>')
                        }
                   }else if(p == "exedu"){  //将教育经历渲染到表格
                        // console.log(data.data.exedu)
                        for(var i in data.data.exedu){
                            var tr;
                            tr = '<td>' + data.data.exedu[i].edu_type + '</td>' + 
                            '<td>' + data.data.exedu[i].graduated_sch + '</td>'  + 
                            '<td>' + data.data.exedu[i].major + '</td>' + 
                            '<td>' + data.data.exedu[i].graduated_time + '</td>' +
                            '<td>' + data.data.exedu[i].edu_system + '</td>' +
                            '<td>' + data.data.exedu[i].degree + '</td>' +
                            '<td>' + data.data.exedu[i].degree_time + '</td>' +
                            '<td>' + data.data.exedu[i].degree_sch + '</td>' +
                            '<td>' + data.data.exedu[i].degree_sch_level + '</td>' +
                            '<td>' + data.data.exedu[i].degree_sch_nature + '</td>' 
                            $("#exedu_table").append('<tr>'+tr+'</tr>')
                        }  
                   }else if(p == "extrain"){
                        // console.log(data.data.extrain)
                        for(var i in data.data.extrain){   //将培训经历渲染到表格
                            var tr;
                            tr = '<td>' + data.data.extrain[i].traindata_name + '</td>' + 
                            '<td>' + data.data.extrain[i].company + '</td>'  + 
                            '<td>' + data.data.extrain[i].traindata_address + '</td>' + 
                            '<td>' + data.data.extrain[i].start_time + '</td>' +
                            '<td>' + data.data.extrain[i].end_time + '</td>' + 
                            '<td>' + data.data.extrain[i].traindata_level + '</td>' + 
                            '<td>' + data.data.extrain[i].issue + '</td>'
                            $("#extrain_table").append('<tr>'+tr+'</tr>')
                        } 
                   }else if(p == "exproject"){
                    // console.log(data.data.exproject）
                        for(var i in data.data.exproject){   //将科研项目渲染到表格
                            var tr;
                            tr = '<td>' + data.data.exproject[i].project_id + '</td>' + 
                            '<td>' + data.data.exproject[i].project_name + '</td>'  + 
                            '<td>' + data.data.exproject[i].project_type + '</td>' 
                            $("#exproject_table").append('<tr>'+tr+'</tr>')  
                        } 
                   }else if(p == "exachievement"){
                    // console.log(data.data.exachievement)   
                        for(var i in data.data.exachievement){   //将科研成果经历渲染到表格
                            var tr;
                            tr = '<td>' + data.data.exachievement[i].achievement_name + '</td>' + 
                            '<td>' + data.data.exachievement[i].publish_company + '</td>'  + 
                            '<td>' + data.data.exachievement[i].publish_time + '</td>' 
                            $("#exachievement_table").append('<tr>'+tr+'</tr>')  
                        } 
                   }else{
                    //    console.log(data.data.exhonor)
                        for(var i in data.data.exhonor){   //将科研成果经历渲染到表格
                            var tr;
                            tr = '<td>' + data.data.exhonor[i].honor_name + '</td>' + 
                            '<td>' + data.data.exhonor[i].honor_time + '</td>'  + 
                            '<td>' + data.data.exhonor[i].honor_company + '</td>' 
                            $("#exhonor_table").append('<tr>'+tr+'</tr>')  
                        } 
                   }
                }
             },
               

            error: function (err) {

            }

        })
    }
     function dealSch(value) {
                  $.ajax({
                    url: '../../index.php/admin/Traindata/School',
                    type: 'POST',
                    data: {
                    },
                    success: function(data) {
                      $("input[field='sch']").val(data.data[value - 1].sch_name)
                    //  $("input[field='sch']").each(resizeInput);
                    },
                    error: function() {
                      alert("error!")
                    }
                  })
                }
           
  </script>
    <style>
    body{
       font-size: 14pt;
      letter-spacing: 1px;
      font-family: FangSong;
      line-height:26pt;	
    }
    @page {
      size: auto;
      margin: 0;
      PAGE-BREAK-AFTER:   always
    }
   .a4-endwise{
      width: 210mm;
      height: 297mm;
      /* border: 1px solid black; */
      border: none;
      padding: 25.4mm 31.8mm 25.4mm 31.8mm;
      word-break: break-all;
    }

    td{
        width:170px;
        height:30px;
        font-size:20px;
    }	
    input{
        border: none;
        overflow: hidden;
        height: 100%;
        width: 100%;
        text-align: center;
        background-color:#FFFFFF;
        font-size: 18px;
    }
    </style>
    </html>
